{extend name="public/base" /}
{block name="css"}
	<!-- webuploder -->
	<link rel="stylesheet" type="text/css" href="__PLUGINS__webuploader/webuploader.css">
    <!-- webuploder END -->
{/block}
{block name="content"}
       <section class="content-header">
<h1>
           添加栏目
<small>add term</small>
</h1>
{present name="$_GET['model_id']"}
<ol class="breadcrumb">
	<li><a href="{:U('Index/index')}"><i class="fa fa-dashboard"></i> 首页</a></li>
	{php}
	$postion = M('term')->where('id='.$_GET['parent_id'])->find();
	{/php}
	<li class="active">添加栏目</li>
	<li class="active">{$postion.name}</li>
</ol>
{else /}
<ol class="breadcrumb">
	<li><a href="{:U('Index/index')}"><i class="fa fa-dashboard"></i> 首页</a></li>
	<li class="active">添加栏目</li>
</ol>
 {/present}

</section>
<!-- Main content -->
<section class="content">
<div class="row">
	<div class="col-xs-12">
		<div class="box">
			<div class="box-header">
				<h3 class="box-title pad">
				<a href="{:U('Term/index')}" class="btn btn-primary">栏目管理</a>&nbsp;&nbsp;
				<a href="{:U('Term/addTerm')}" class="btn  btn-primary">添加栏目</a>&nbsp;&nbsp;
				<!-- <a href="{:U('Term/addTerm')}" class="btn  btn-primary">更新栏目缓存</a>&nbsp;&nbsp; -->
				</h3>
			</div>
			<form action="{:U('Term/addTerm')}" method="post">
				<div class="box-body" style="padding-top: 0">
					<!--输入框 -->
					
                  
				  {present name="$_GET['model_id']"}
                     <input type="hidden" name="parent_id" value="{$_GET['parent_id']}" >
					 				<div class="box-body pad" style="padding-top: 0;">
					  <label>所属模型</label>

							<select name="model_id" class="form-control">
								<option value="0">请选择模型</option>
								
								{foreach $modelList as $id => $model}
								<option value="{$id}" >{$model}</option>
								{/foreach}
								
							</select>
						</div>
					{else /}
					
				<div class="box-body pad" style="padding-top: 0;">
					  <label>所属模型</label>

							<select name="model_id" class="form-control">
								<option value="0">请选择模型</option>

								
								{foreach $modelList as $id => $model}
								<option value="{$id}" >{$model}</option>
								{/foreach}
								
							</select>
						</div>
						<div class="box-body pad">
						 <label>所属栏目：</label>
							<select name="parent_id" class="form-control" id="select_id">
								<option value="0">作为一级栏目</option>
					{volist name="all_term" id="data"}
								<option value="{$data.id}">{$data.name}</option>
					{/volist}
							</select>
						</div>
					
					 {/present}
				
					<div class="box-body pad">
					    <label>名称:</label>
						<input class="form-control" name="name" placeholder="栏目名称">
					</div>
					<div class="box-body pad">
					    <label>标识:</label>
						<input class="form-control" name="flag" placeholder="栏目标识">
					</div>
					<div class="box-body pad">
					     <label>描述:</label>
						<textarea class="form-control" rows="4" name="description" placeholder="添加栏目描述"></textarea>
					</div>
					<div class="box-body pad" id="btn">
			            是否为楼盘：			           
			           	<input type="radio" name="display_nav" value="1" >是&nbsp;&nbsp;
						<input type="radio" name="display_nav" value="0" checked="checked">否&nbsp;&nbsp;
					</div>
					<!-- 
					<script type="text/javascript" language="javascript">
					$(function(){
						  $("#btn").click(function(){
						  	  var val=$('input:radio[name="display_nav"]:checked').val();
						  	 if(val == 1){
						  	 	$("#display").html('<div class="box-body pad" style="padding:10px 20px;"><label>地区:</label><input class="form-control" name="area" value="" placeholder="地区"></div><div class="box-body pad" style="padding:10px 20px;"><label>均价:</label><input class="form-control" name="junjia" value="" placeholder="均价"></div><div class="box-body pad" style="padding:10px 20px;"><label>户型:</label><input class="form-control" name="huxing" value="" placeholder="户型"></div><div class="box-body pad" style="padding:10px 20px;"><label>产权:</label><input class="form-control" name="chanquan" value="" placeholder="产权"></div><div class="box-body pad" style="padding:10px 20px;"><label>开盘:</label><input class="form-control" name="kaipan" value="" placeholder="开盘"></div><div class="box-body pad" style="padding:10px 20px;"><label>房屋类别:</label><input class="form-control" name="fangtype" value="" placeholder="房屋类型"></div>');
						  	 }else{
						  	 	$("#display").html('');
						  	 }
						  });
					});
					</script>
					 -->
					<!-- 新增字段 -->
					<div id='display'>
					</div>
					
					<!-- 新增字段 END-->
                   <!-- 选项卡 -->
					<style>
					.box-activeadd {
                     font-size:20px;
                     color:#999;
                     cursor: pointer;
					}
					</style>
					<div class="box-header with-border box-addtab" style="margin:0 18px;padding-left:0;">
						<a class="box-activeadd" >搜索设置</a>
						<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
						<a >高级设置</a>
						<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
						<a >SEO设置</a>
					<script type="text/javascript">
						$(function(){
							$(".box-addtab a").each(function(j){
								var num=j+1;
								$(this).click(function(){
									$(".box-addtab a").attr("class","");
									$(this).attr("class","box-activeadd");
									for(var i=1;i<=3;i++){
										$("#tab_kc"+i).css("display","none");
									}
									$("#tab_kc"+num).css("display","block");
								});
							});
						})
					</script>						
					</div>	
					<!-- 选项卡 -->	
					<!-- 搜索设置 -->
					<div class="tab-add" id="tab_kc1">
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>地区:</label>
						<input class="form-control" name="area" value="" placeholder="地区">
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>均价:</label>
						<input class="form-control" name="junjia" value="" placeholder="均价">
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>户型:</label>
						<input class="form-control" name="huxing" value="" placeholder="户型">
					</div>	
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>产权:</label>
						<input class="form-control" name="chanquan" value="" placeholder="产权">
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>开盘:</label>
						<input class="form-control" name="kaipan" value="" placeholder="开盘">
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>房屋类型:</label>
						<input class="form-control" name="fangtype" value="" placeholder="房屋类型">
					</div>									
					</div>
					<!-- 搜索设置 END-->
					<!-- 高级设置 -->
					<div class="tab-add" id="tab_kc2" style="display:none">
                    <div class="box-header with-border" style="margin:0 18px;padding-left:0;">
						<h3 class="box-title" >高级设置:</h3>
					</div>											
	                    {foreach $formList as $name => $form}
						<div class="box-body pad" style="padding:10px 20px;">
	                    {$name}:
	                    {$form}
						</div>
	                    {/foreach}	                 															
											
					</div>
					<!-- 高级设置END-->

					<!-- SEO设置 -->
					<div class="tab-add" id="tab_kc3" style="display: none">
                <div class="box-header with-border" style="margin:0 18px;padding-left:0;">
						<h3 class="box-title" >SEO设置:</h3>
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>标题:</label>
						<input class="form-control" name="seo_title" value="" placeholder="SEO标题">
					</div>
					<div class="box-body pad" style="padding:10px 20px;">
					    <label>关键词:</label>
						<input class="form-control" name="seo_keywords" value="" placeholder="SEO关键词">
					</div>
					<div class="box-body pad" style="padding:10px 20px 0px 20px;">
					    <label>摘要:</label>
						<textarea class="form-control" rows="4" name="seo_description" value="" placeholder="SEO描述"></textarea>
					</div>									
					</div>
					<!-- SEO设置 END-->
					<!--输入框 END-->
					



				</div>

				
				<!-- END -->
				<div class="box-body pad">
					<div class="box-footer">
					<input type="submit" class="btn btn-block btn-primary" style="width:100px; border:none; margin-bottom:20px;" value="提交"/>
				</div>
				</div>
				
				
				<div style="clear:both">
				</div>
			</form>
		</div>
	</div>
</div>
</section>   
        
{/block}
{block name="script"}
{/block}
